<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>我是1</div>
    <button id="hui">回到初始页面</button>
    <button id="hui2">到2页面</button>

    <script>
        var hui=document.getElementById('hui');
        hui.onclick=function(){
            history.back();
        }
        var hui2=document.getElementById('hui2');
        hui2.onclick=function(){
            location='history2.html'
        }
    </script>
</body>
</html>